package com.example.back.impl;

import com.example.back.mapper.BoardgameMapper;
import com.example.back.model.Boardgame;
import com.example.back.service.BoardgameService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class BoardgameServiceImpl implements BoardgameService {

    @Resource
    private BoardgameMapper boardgameMapper;

    @Override
    public List<Boardgame> findAllBoardgame() {
        return boardgameMapper.findAllBoardgame();
    }

    @Override
    public List<Boardgame> selectBCount(int bCount) {
        return boardgameMapper.selectBCount(bCount);
    }

    @Override
    public List<Boardgame> selectBName(String name) {
        return boardgameMapper.selectBName(name);
    }

    @Override
    public Boolean insertBoardgame(String name, String introduction, int lowerLimit, int upperLimit, int rank, int position) {
        return boardgameMapper.insertBoardgame(name, introduction, lowerLimit, upperLimit, rank, position);
    }

    @Override
    public Boolean updateRankByID(int id, int rank) {
        return boardgameMapper.updateRankByID(id, rank);
    }

    @Override
    public Boolean updatePositionByID(int id, int position) {
        return boardgameMapper.updatePositionByID(id, position);
    }

    @Override
    public Boolean deleteBoardgame(int id) {
        return boardgameMapper.deleteBoardgame(id);
    }

    @Override
    public String findPhotoByID(int id) {
        return boardgameMapper.findPhotoByID(id);
    }
}
